#include "../utils/jsoncx.h"
#include <stdio.h>
#include <stdlib.h>

// 编译命令:gcc utils_jsoncx_test.c ../utils/jsoncx.c -o main -lm
int main()
{
    jsoncx *root = jsoncx_createobject();
    jsoncx_addbooltoobject(root, "test_model", 1);
    jsoncx_addstringtoobject(root, "name", "小猪历险记");
    const char *type_strs[] = {"背包危机", "抽卡", "类吸血鬼"};
    jsoncx *types = jsoncx_createstringarray(type_strs, sizeof(type_strs) / sizeof(char *));
    jsoncx_additemtoobject(root, "type", types);
    char *json_str = jsoncx_print(root);
    printf("%s\n", json_str);
    free(json_str);
    jsoncx_delete(root);
    return 0;
}